package com.ruoyi.merchant.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;

/**
 * 消息会话对象
 */
public class MessageSession {
    private static final long serialVersionUID = 1L;

    /** 会话ID */
    private Long sessionId;

    /** 消息类型：customer-顾客消息，platform-平台消息，group-群消息 */
    private String msgType;

    /** 用户信息 */
    private UserInfo userInfo;

    /** 发送者信息 */
    private SenderInfo senderInfo;

    /** 最后一条消息 */
    private LastMessage lastMessage;

    /** 关联订单信息 */
    private RelatedOrder relatedOrder;

    /** 未读消息数 */
    private Integer unreadCount;

    public static class UserInfo {
        private Long userId;
        private String userName;
        private String phoneSuffix;
        private String avatar;
        private Boolean isOnline;

        // getter/setter
        public Long getUserId() { return userId; }
        public void setUserId(Long userId) { this.userId = userId; }
        public String getUserName() { return userName; }
        public void setUserName(String userName) { this.userName = userName; }
        public String getPhoneSuffix() { return phoneSuffix; }
        public void setPhoneSuffix(String phoneSuffix) { this.phoneSuffix = phoneSuffix; }
        public String getAvatar() { return avatar; }
        public void setAvatar(String avatar) { this.avatar = avatar; }
        public Boolean getIsOnline() { return isOnline; }
        public void setIsOnline(Boolean isOnline) { this.isOnline = isOnline; }
    }

    public static class SenderInfo {
        private Long senderId;
        private String senderName;
        private String avatar;

        // getter/setter
        public Long getSenderId() { return senderId; }
        public void setSenderId(Long senderId) { this.senderId = senderId; }
        public String getSenderName() { return senderName; }
        public void setSenderName(String senderName) { this.senderName = senderName; }
        public String getAvatar() { return avatar; }
        public void setAvatar(String avatar) { this.avatar = avatar; }
    }

    public static class LastMessage {
        private String content;
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date sentAt;
        private Boolean isRead;
        private String senderType;

        // getter/setter
        public String getContent() { return content; }
        public void setContent(String content) { this.content = content; }
        public Date getSentAt() { return sentAt; }
        public void setSentAt(Date sentAt) { this.sentAt = sentAt; }
        public Boolean getIsRead() { return isRead; }
        public void setIsRead(Boolean isRead) { this.isRead = isRead; }
        public String getSenderType() { return senderType; }
        public void setSenderType(String senderType) { this.senderType = senderType; }
    }

    public static class RelatedOrder {
        private Long orderId;
        private String status;

        // getter/setter
        public Long getOrderId() { return orderId; }
        public void setOrderId(Long orderId) { this.orderId = orderId; }
        public String getStatus() { return status; }
        public void setStatus(String status) { this.status = status; }
    }

    // getter/setter
    public Long getSessionId() { return sessionId; }
    public void setSessionId(Long sessionId) { this.sessionId = sessionId; }
    public String getMsgType() { return msgType; }
    public void setMsgType(String msgType) { this.msgType = msgType; }
    public UserInfo getUserInfo() { return userInfo; }
    public void setUserInfo(UserInfo userInfo) { this.userInfo = userInfo; }
    public SenderInfo getSenderInfo() { return senderInfo; }
    public void setSenderInfo(SenderInfo senderInfo) { this.senderInfo = senderInfo; }
    public LastMessage getLastMessage() { return lastMessage; }
    public void setLastMessage(LastMessage lastMessage) { this.lastMessage = lastMessage; }
    public RelatedOrder getRelatedOrder() { return relatedOrder; }
    public void setRelatedOrder(RelatedOrder relatedOrder) { this.relatedOrder = relatedOrder; }
    public Integer getUnreadCount() { return unreadCount; }
    public void setUnreadCount(Integer unreadCount) { this.unreadCount = unreadCount; }
}